using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class BatchDetailMap : EntityTypeConfiguration<BatchDetail>
	{
		public BatchDetailMap()
		{
			// Primary Key
			this.HasKey(t => t.BatchDetailID);

			// Properties
			this.Property(t => t.BatchNO)
				.IsRequired()
				.HasMaxLength(20);
				
			this.Property(t => t.CustomerBatchNO)
				.HasMaxLength(20);
				
			this.Property(t => t.CustomerOrder)
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("BatchDetail");
			this.Property(t => t.BatchDetailID).HasColumnName("BatchDetailID");
			this.Property(t => t.BatchNO).HasColumnName("BatchNO");
			this.Property(t => t.WayBillNo).HasColumnName("WayBillNo");
			this.Property(t => t.CustomerBatchNO).HasColumnName("CustomerBatchNO");
			this.Property(t => t.CustomerOrder).HasColumnName("CustomerOrder");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
		}
	}
}

